package com.itheima.edu.practice.test;

public class VariableParameter {
    //可变参数练习
    public static void main(String[] args) {
        int sum = getSum(10,100,109);
        System.out.println(sum);
    }

    private static int getSum(int...a) {
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            sum += a[i];
        }
        return sum;
    }
}
